<template>
	<view>
		<view class="">{{ itemInfo.title }}</view>
		<text>作者：{{ itemInfo.author }}</text>
		<view class="content" v-html="itemInfo.content"></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			itemInfo: {}
		}
	},
	onLoad(options) {
		const { id } = options;
		uni.request({
			url: 'https://ku.qingnian8.com/dataApi/news/detail.php',
			data: {
				id
			}
		}).then(res => {
			res.data.content = res.data.content.replace(/<img/g, '<img style="width:100vw"')
			this.itemInfo = res.data;
			uni.setNavigationBarTitle({
				title: res.data.title
			})
		})
	},
	methods: {

	}
}
</script>

<style lang="scss">
.content {
	image {
		width: 750rpx;
	}
}
</style>
